<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String servers=request.getScheme()+"://"+request.getServerName();
//String serverss="http://192.168.0.10:8099";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>首页</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
<jsp:include page="/scripts/common/index.html"></jsp:include>
<jsp:include page="/scripts/jquery/index.html"></jsp:include>
<jsp:include page="/scripts/dhtmlx/index.html"></jsp:include>
<jsp:include page="/scripts/bootstrap/index.html"></jsp:include>
<link rel="stylesheet" href="${basePath }style/default.css">
<script type="text/javascript" src="${basePath }setpentaho/SetAddress.js" >
</script>
	<script type="text/javascript">
	document.domain = pentaho_address;
	var treeId;
	var treeName;
	var treeType="type";
	var treeData;
	function init() {
		addMenu();
		//预加载
		$("#xzspiframe").attr("src", pentaho_address+"/pentaho/plugin/pentaho-cdf-dd/api/renderer/render?solution=public&path=GX&file=xzspsc1.wcdf&userid=admin&password=password");
		//$("#xzspiframe1").height("550px");
		$("#xzspiframe1").height("0px");
	}
	//加载树数据
	function addMenu() {
		
		var content1=["1","0","行政审批","type"];//1级别
		//生产
		var content2=["2","1","食品生产许可情况","type2"];//2级别
		var contents1=["sc1","2","指标分析","type3"];//3级别
		var contentss1=["sc11","sc1","食品生产许可数","scpage1"];//4级别
		var contentss2=["sc12","sc1","食品生产获证企业数","scpage11"];//4级别
		var contents2=["sc2","2","多维分析","type3"];//3级别
		var contentss3=["sc21","sc2","生产许可情况","scpage2"];//4级别
		var contents3=["sc3","2","统计分析","type3"];//3级别
		var contentss4=["sc31","sc3","生产许可报表","scpage3"];//4级别
		//经营
		var content3=["3","1","食品经营许可情况","type2"];//2级别
		var contentj1=["jy1","3","指标分析","type3"];//3级别
		var contentjs1=["jy11","jy1","食品经营许可数","jypage1"];//4级别
		var contentjs2=["jy12","jy1","食品经营获证企业数","jypage11"];//4级别
		var contentj2=["jy2","3","多维分析","type3"];//3级别
		var contentjs3=["jy21","jy2","经营许可情况","jypage2"];//4级别
		var contentj3=["jy3","3","统计分析","type3"];//3级别
		var contentjs4=["jy31","jy3","经营许可报表","jypage3"];//4级别
		var contentsinfo={code:"0",status:true,content:[content1,content2,content3,
		                                                contents1,contents2,contents3,contentj1,contentj2,contentj3,
		                                                contentss1,contentss2,contentss3,contentss4,
		                                                contentjs1,contentjs2,contentjs3,contentjs4
		                                                ]};
		console.log(contentsinfo.content);
		treeData=contentsinfo.content;
		getTree().parse(contentsinfo.content, "jsarray");
		getTree().openItem("1");
		getTree().selectItem("1");
		
	}
	//点击树形的时候获得相应的数据
	function onSelect(id, name, pid) {
		treeId = id;//树形上的id
		treeName = name;//树形的名字
		//query(treeId);//调用此方法查询相应的数据
		queryTreeType();
		
		if(treeType == "scpage1") {
			$("#title").html("");
			$("#title").hide();
			$("#xzsp1").width("100%");
			$("#xzsp2").width("0%");
			//$("#xzspiframe").height("550px");
			$("#xzspiframe").attr("src", pentaho_address+"/pentaho/plugin/pentaho-cdf-dd/api/renderer/render?solution=public&path=GX&file=xzspsc1.wcdf&userid=admin&password=password");
			
			$("#xzspiframe1").height("1px");
		}if(treeType == "scpage11") {
			$("#title").show();
			$("#title").html("<center>食品生产-获证企业统计</center>");
			$("#xzsp1").width("50%");
			$("#xzsp2").width("50%");
			$("#xzspiframe").attr("src", pentaho_address+"/pentaho/plugin/pentaho-cdf-dd/api/renderer/render?solution=public&path=GX&file=xzspsc11.wcdf&userid=admin&password=password");
			$("#xzspiframe1").height("99%");
			$("#xzspiframe1").attr("src", "/GX_IRAP/echarts-master/XZSP_HZQYS.jsp");
		}else  if(treeType == "scpage2") {
			$("#title").show();
			$("#xzsp1").width("100%");
			$("#xzsp2").width("0%");
			$("#title").html("<center>食品生产许可多维分析情况</center>");
	    	$("#xzspiframe").attr("src", "/GX_IRAP/ztpage.jsp?query=foods-sc");
	    	$("#xzspiframe1").height("1px");
	    }else  if(treeType == "scpage3") {
	    	//window.location.href="page/bi/xzsp/toxzspsc";
	    	$("#title").html("");
	    	$("#title").hide();
	    	$("#xzsp1").width("100%");
			$("#xzsp2").width("0%");
	    	$("#xzspiframe").attr("src", "/GX_IRAP/page/bi/xzsp/toxzspsc");
	    	$("#xzspiframe1").height("1px");
	    }else if(treeType == "jypage1") {
	    	$("#title").html("");
	    	$("#title").hide();
	    	$("#xzsp1").width("100%");
			$("#xzsp2").width("0%");
	    	$("#xzspiframe").attr("src", pentaho_address+"/pentaho/plugin/pentaho-cdf-dd/api/renderer/render?solution=public&path=GX&file=xzspjys.wcdf&userid=admin&password=password");
	    	$("#xzspiframe1").height("1px");
	    }else if(treeType == "jypage11") {
	    	$("#title").show();
	    	$("#title").html("<center>食品经营-获证企业统计</center>");
	    	$("#xzsp1").width("50%");
			$("#xzsp2").width("50%");
	    	$("#xzspiframe").attr("src", pentaho_address+"/pentaho/plugin/pentaho-cdf-dd/api/renderer/render?solution=public&path=GX&file=xzspjy.wcdf&userid=admin&password=password");
			$("#xzspiframe1").height("99%");
			$("#xzspiframe1").attr("src", "/GX_IRAP/echarts-master/XZSP_JYMAP.jsp");
	    }else if(treeType == "jypage2") {
	    	$("#title").show();
	    	$("#xzsp1").width("100%");
			$("#xzsp2").width("0%");
	    	$("#title").html("<center>食品经营许可多维分析情况</center>");
	    	$("#xzspiframe").attr("src", "/GX_IRAP/ztpage.jsp?query=foods-jy");
	    	$("#xzspiframe1").height("1px");
	    }else if(treeType == "jypage3") {
	    	$("#title").html("");
	    	$("#title").hide();
	    	$("#xzsp1").width("100%");
			$("#xzsp2").width("0%");
	    	$("#xzspiframe").attr("src", "/GX_IRAP/page/bi/xzsp/toxzspjy");
	    	$("#xzspiframe1").height("1px");
	    }
		$("#title").find("center").css("font-size","18px")
	}
	function queryTreeType(){
		for (var i in treeData){
			
			
			if(treeData[i][0] == treeId){
				treeType = treeData[i][3];
			}
		}
	}
	
	</script>
<style type="text/css">
  br {
    clear: both;
  }
</style>
  </head>
  
  <body onload="init()" style="margin: 0;" margin-top="0">
    <div style="display: flex;height:auto">
    <!-- 左边的div -->
     <div style="height: 100%;overflow: auto;width: 250px;border-right: 1px solid #ccc">
					<jsp:include page="/common/tree.jsp">
						<jsp:param value="getTree" name="getTree" />
						<jsp:param value="false" name="isCheck" />
						<jsp:param value="onSelect" name="onSelect" />
					</jsp:include>
	</div>
    <!-- 右边的div -->
    
    <div style="overflow:auto;width:auto;flex: 1;">
    
    <div id="title" style="margin-top: 10px">  </div>
     <!-- 	<iframe id="xzspiframe1" src="" width="100%" height="95%" style="text-align: center;border:none;"></iframe> -->
 <div style="height:99%; border:1px; overflow:hidden;">
  <div style=" float:left; width:100%; height:98%;" id="xzsp1">
  <iframe id="xzspiframe" src="" width="100%" height="90%" style="text-align: center;border:none;padding:0 30px"></iframe>
  </div>
  <div style=" float:left; width:100%; height:98%;" id="xzsp2">
   <iframe id="xzspiframe1" src="" width="100%" height="90%" style="text-align: center;border:none;padding:0 30px"> </iframe>
  </div>
 </div>
    </div>
    
    </div>
  </body>
</html>
